<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">

    <title>Document</title>

    <script src="./js/vue.js"></script>
</head>

<body>

    <div id="story" style="width: 600px;border: solid;">
        <h1 align=" center">我爱的故事</h1>
        <div align="center" style="background-color:gray">
            <input type="text" v-bind:value="poetry[0].value"><button id="show" type="button"
                @click="flag=!flag">{{flag?"关闭":"展开"}}</button>
        </div>
        <div v-show="flag" v-for=" s in poetry" :key="s.name">
            {{s.value}}
        </div>

    </div>

    <script>
        new Vue({
            el: "#story",
            data: {
                flag: false,
                poetry: [{ "name": "0", "value": "送元二使安西" },
                { "name": "1", "value": "渭城朝雨浥轻尘，" }, 
                { "name": "2", "value": "客舍青青柳色新。" },
                { "name": "3", "value": "劝君更尽一杯酒，" },
                { "name": "4", "value": "西出阳关无故人。" }
            ]
            },
            methods: {

            }
        }) 
    </script>
</body>
</html>